package Reader;

import java.io.*;

public class buffReader {
    public static void main(String[] args) throws IOException {
        BufferedWriter writer = new BufferedWriter(new FileWriter("D:\\test\\b.txt",true));
        String str1="测试text1";
        String str2="测试text2";
        writer.write(str1);
        writer.newLine();
        writer.write(str2);
        writer.flush();
        writer.close();
    }

    private static void text1() throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\test\\b.txt"));
        String str = null;
        while ((str=bufferedReader.readLine())!=null) {
            System.out.println(str);
        }
        bufferedReader.close();
    }

}
